package org.intrasearch.spider;

import org.intrasearch.core.ArtifactId;
import org.intrasearch.core.InvertedIndex;
import org.intrasearch.core.mapreduce.ReduceTask;

import java.util.SortedSet;

public class InvertedIndexReduceTask implements ReduceTask<String, ArtifactId>
{
    private final InvertedIndex invertedIndex;

    public InvertedIndexReduceTask(InvertedIndex invertedIndex)
    {
        this.invertedIndex = invertedIndex;
    }

    public void reduce(String key, SortedSet<ArtifactId> values)
    {
        invertedIndex.put(key, values);
    }
}
